home *** CD-ROM | disk | FTP | other *** search
- :
- trap 'rm -f conftest conftest.c uttest; exit 1' 1 3 15
-
- set +u # Make sure unset variables are ok.
-
- CC=gcc
- RANLIB=echo
- PROGS=
- DEFS="-DSIGTYPE=int -DSTDC_HEADERS -DFCHMOD_MISSING -DFTIME_MISSING -DMKFIFO_MISSING -DFTRUNCATE_MISSING"
- LIBS=
- LIBPROGS=
- LIBOBJS="fnmatch.o stpcpy.o"
-
- # A filename unique to this package, relative to the directory that
- # configure is in, which we can look for to find out if srcdir is correct.
- unique_file=src/ls.c
-
- for arg in $*; do
- # Handle +srcdir with a space before the argument.
- if [ x$next_srcdir = xyes ]; then srcdir=$arg; next_srcdir=
- # Handle +host with a space before the argument.
- elif [ x$next_host = xyes ]; then next_host=
- else
- case $arg in
- -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*)
- srcdir=`echo $arg | sed 's/[+-]s[a-z]*=//'` ;;
- -srcdir | +srcdir | +srcdi | +srcd | +src | +sr | +s)
- next_srcdir=yes ;;
- -host=* | +host=* | +hos=* | +ho=* | +h=*) ;;
- -host | +host | +hos | +ho | +h)
- next_host=yes ;;
- -gas | +gas | +ga | +g) ;;
- -nfp | +nfp | +nf | +n) ;;
- *) ;;
- esac
- fi
- done
-
- vpsub='s@\$\([-./a-zA-Z0-9]*\)<@\1@g'
- # Find the source files, if location was not specified.
- if [ x$srcdir = x ]; then
- srcdirdefaulted=yes; srcdir=.
- if [ ! -r $unique_file ]; then srcdir=`pwd`/..; fi
- fi
- if [ $srcdir != . ]; then
- VPATH='VPATH = $(srcdir)'
- vpsub='s@\$\([-./a-zA-Z0-9]*\)<@\$<@g'
- fi
-
- if [ ! -r $srcdir/$unique_file ]; then
- if [ x$srcdirdefaulted = xyes ]; then
- echo "$0: Can not find sources in \`.' or \`..'." 1>&2
- else
- echo "$0: Can not find sources in \`${srcdir}'." 1>&2
- fi
- exit 1
- fi
-
- CC=${CC-cc}
- RANLIB=${RANLIB-echo}
- INCLUDEDIR=${INCLUDEDIR-/usr/include}
-
- rm -f conftest conftest.c
- compile="$CC $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1"
-
- case "$LIBOBJS" in
- *rename.o*)
- LIBPROGS="$LIBPROGS mvdir"
- DEFS="$DEFS -DMVDIR="'\\"$(libdir)/mvdir\\"'
- ;;
- esac
-
- trap 'rm -f Makefile lib/Makefile src/Makefile man/Makefile config.status; exit 1' 1 3 15
-
- for dir in . lib src man
- do
- test -d $dir || mkdir $dir
- echo '# Generated automatically from Makefile.in by configure.' > $dir/Makefile
- sed -e "
- $vpsub
- s,@srcdir@,$srcdir,
- s,@VPATH@,$VPATH,
- s,@CC@,$CC,
- s,@RANLIB@,$RANLIB,
- s,@PROGS@,$PROGS,
- s,@DEFS@,$DEFS,
- s,@LIBS@,$LIBS,
- s,@LIBPROGS@,$LIBPROGS,
- s,@LIBOBJS@,$LIBOBJS,
- " $srcdir/$dir/Makefile.in >> $dir/Makefile
- done
-
-